const KoaRouter = require('koa-router');
const router = new KoaRouter();
// const routes = require('./routes');

const { scanFiles } = require('../common/files');

const routes = scanFiles('/router');

routes.forEach(item => {
  const { method, path, validate, controller } = item;
  router[method](path, validate, controller);
});

module.exports = router;